﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.Plugin.Contract.Enum;
using DWF.Studio.Share.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.Plugin.Loader.Config
{
    /// <summary>
    /// 插件配置
    /// </summary>
    public class PluginConfig
    {
        /// <summary>
        /// 加载
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static PluginConfig Load(string path)
        {
            var config = YamlHelper.Load<PluginConfig>(path);
            config.Path = path;
            return config;
        }

        /// <summary>
        /// 路径
        /// </summary>
        public string Path
        {
            get;
            private set;
        }

        /// <summary>
        /// 保存
        /// </summary>
        public void Save()
        {
            YamlHelper.Save(this, Path);
        }

        /// <summary>
        /// 插件文件名称
        /// </summary>
        public string FileName
        {
            get;
            set;
        }

        /// <summary>
        /// 友好名称
        /// </summary>
        public string FriendlyName
        {
            get;
            set;
        }
        /// <summary>
        /// 组名
        /// </summary>
        public string GroupName
        {
            get;
            set;
        }
        /// <summary>
        /// 插件id
        /// </summary>
        public string Id
        {
            get;
            set;
        }
        /// <summary>
        /// 插件版本
        /// </summary>
        public string Version
        {
            get;
            set;
        }
        /// <summary>
        /// 类型
        /// </summary>
        public EPluginType Type
        {
            get;
            set;
        }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description
        {
            get;
            set;
        }
        /// <summary>
        /// 样式Uri
        /// </summary>
        public string Icon
        {
            get;
            set;
        }
        /// <summary>
        /// 样式Uri
        /// </summary>
        public string StyleUri
        {
            get;
            set;
        }
        /// <summary>
        /// 样式Key
        /// </summary>
        public string StyleKey
        {
            get;
            set;
        }
        /// <summary>
        /// 提示
        /// </summary>
        public string ToolTip
        {
            get;
            set;
        }
    }
}
